package jp.sourceforge.akjrcp.akj_betas;

import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

	public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
		super(configurer);
	}

	public ActionBarAdvisor createActionBarAdvisor(
			IActionBarConfigurer configurer) {
		return new ApplicationActionBarAdvisor(configurer);
	}

	public void preWindowOpen() {
		IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
		configurer.setInitialSize(new Point(850, 720));
		configurer.setShowPerspectiveBar(true);
		
		configurer.setShowCoolBar(true);
		configurer.setShowStatusLine(true);
		configurer.setTitle(Messages.getString("akjbetas_title"));
		
		

	}
	
    public void postWindowCreate(){
    	//this is for call preference initializer for Shared.
        Akj_betasPlugin.getDefault().getPluginPreferences().getBoolean("test");
        
    	/* no effect?
    	IWorkbenchPage p1= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    	PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideActionSet("org.eclipse.ui.NavigateActionSet");
    	PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideActionSet("org.eclipse.ui.actionSet.keyBindings");
    	PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideActionSet("org.eclipse.ui.WorkingSetActionSet");
    	PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideActionSet("org.eclipse.update.ui.softwareUpdates");
    	
    	*/
    	
    	
    	
    	
		
    	
  


    	
    }
	
	public boolean preWindowShellClose(){
		Akj_betasPlugin.getDefault().savePluginPreferences();
		return true;
	}
	
}
